CC = gcc
FLAGS = -I ./Ntyco/core/ -L ./Ntyco  -lntyco -lpthread -ldl #-g -fsanitize=address -fno-omit-frame-pointer
SRCS = Kvstore.c Ntyco_entry.c Epoll_entry.c  Kvstore_array.c  Kvstore_rbtree.c  Kvstore_mp.c     #$(wildcard *.c)
TESTCASE_SRCS = Testcase.c
TARGET = kvstore
SUBDIR = ./Ntyco
TESTCASE = testcase

OBJS = $(SRCS:.c=.o)

all: $(SUBDIR) $(TARGET) $(TESTCASE)

$(SUBDIR): ECHO
	make -C $@

ECHO:
	@echo $(SUBDIR)

$(TARGET): $(OBJS)
	$(CC) $^ -o $@ $(FLAGS)

$(TESTCASE):$(TESTCASE_SRCS)
	$(CC) $^ -o $@

%.o : %.c
	$(CC) -c $< -o $@ $(FLAGS)

clean:
	rm -rf $(OBJS) $(TARGET) $(TESTCASE)